package com.min.kafka.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * kafka消息封装, 带发送次数
 * @author: fengt
 * @date: 2021/4/1 18:14
 **/
@Data
public class KMessage<T> implements Serializable {

    /**
     * 发送次数,每发送一次加1
     **/
    private int count = 0;

    /**
     * 消息主体
     **/
    private T body;

    public KMessage() {
    }

    public KMessage(int count, T body) {
        this.count = count;
        this.body = body;
    }

    public KMessage(T body) {
        this.body = body;
    }
}
